package com.netease.c;

import java.io.UnsupportedEncodingException;

public class f
{
  static String a = "UTF-8";

  public static String a(String paramString)
  {
    Object localObject = null;
    try
    {
      String str = a(paramString, a);
      localObject = str;
      label12: return localObject;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      break label12;
    }
  }

  public static String a(String paramString1, String paramString2)
  {
    int i = paramString1.length();
    if (i > 500);
    StringBuffer localStringBuffer;
    for (int j = i / 2; ; j = i)
    {
      localStringBuffer = new StringBuffer(j);
      if (paramString2.length() != 0)
        break;
      throw new UnsupportedEncodingException("URLDecoder: empty string enc parameter");
    }
    byte[] arrayOfByte = null;
    int k = 0;
    int m = 0;
    char c;
    int i4;
    while (k < i)
    {
      c = paramString1.charAt(k);
      switch (c)
      {
      default:
        localStringBuffer.append(c);
        k++;
        break;
      case '+':
        localStringBuffer.append(' ');
        k++;
        m = 1;
        break;
      case '%':
        if (arrayOfByte != null)
          break label333;
        i4 = i - k;
      }
    }
    while (true)
    {
      int i2;
      int i3;
      try
      {
        arrayOfByte = new byte[i4 / 3];
        break label333;
        if ((k + 2 >= i) || (i1 != 37))
          continue;
        i2 = n + 1;
        arrayOfByte[n] = (byte)Integer.parseInt(paramString1.substring(k + 1, k + 3), 16);
        i3 = k + 3;
        if (i3 >= i)
          break label322;
        i1 = paramString1.charAt(i3);
        k = i3;
        n = i2;
        continue;
        if ((k < i) && (i1 == 37))
          throw new IllegalArgumentException("URLDecoder: Incomplete trailing escape (%) pattern");
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new IllegalArgumentException("URLDecoder: Illegal hex characters in escape (%) pattern - " + localNumberFormatException.getMessage());
      }
      localStringBuffer.append(new String(arrayOfByte, 0, n, paramString2));
      m = 1;
      break;
      if (m != 0)
        paramString1 = localStringBuffer.toString();
      return paramString1;
      label322: k = i3;
      int n = i2;
      continue;
      label333: n = 0;
      int i1 = c;
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.c.f
 * JD-Core Version:    0.6.0
 */